package robot.devices;

import robot.Robot;
import robot.exception.RobotException;
import robot.protocol.DATA_DESCRIPTOR;
import robot.protocol.MODULE;


public class All extends Device {

	public All(Robot robot) {
		super(robot, MODULE.MAIN, DATA_DESCRIPTOR.IR_ON_OFF);
	}
	
	public byte[] getAll() throws RobotException {
		return this.getParameter(29);
	}
	
	public void setTimeout () throws RobotException {
		this.setParameter((byte) 0x01, DATA_DESCRIPTOR.RESET);
		byte [] values = this.getParameter(1, DATA_DESCRIPTOR.CONFIGURATION);
		if (values[0] != (byte) 0x00)
		System.out.println("TIMEOUT : " + values[0]);
		
		this.setParameter((byte) 0x00, DATA_DESCRIPTOR.CONFIGURATION);
		
		values = this.getParameter(1, DATA_DESCRIPTOR.CONFIGURATION);
		
		System.out.println("TIMEOUT : " + values[0]);
		
	}
	
}
